package com.example.goods_service.config;

import com.example.goods_service.vo.*;

import java.util.List;

public class DiGuiConfig
{
    public static void getdetails(List<T_category_attribute> a, List<T_attribute_details> details)
    {
        for (T_category_attribute attribute : a) {
            for (T_attribute_details detail : details) {
                if (attribute.getId()==detail.getAttribute_id())
                {
                    attribute.getChild().add(detail);
                }

            }
        }
    }

    public static   void getsmallleimu(T_commodity_category category, List<T_commodity_category> small)
    {
        for (T_commodity_category s : small) {
            if (category.getId()==s.getCategory_parent_ID())
            {
                category.getChild().add(s);
                getsmallleimu(s,small);
            }
        }
    }
    public static void getleimu( List<T_commodity_category> big, List<T_commodity_category> small)
    {
        for (T_commodity_category b : big) {
            for (T_commodity_category a : small) {
                if (b.getId()==a.getCategory_parent_ID())
                {
                    b.getChild().add(a);
                    getsmallleimu(a,small);
                }
            }
        }
    }

    public static void getconfig(List<T_category_config> configs, List<T_config_details> details)
    {
        for (T_category_config config : configs) {
            for (T_config_details detail : details) {
                 if (config.getId() == detail.getConfig_id())
                 {
                     config.getChild().add(detail);
                 }
            }
        }
    }

}
